{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "===========================\n",
      "#require 'minitest/autorun'\n",
      "require '/Users/ftakao2007/work/jupyter/vendor/bundle/ruby/2.3.0/gems/minitest-5.10.2/lib/minitest/autorun'\n",
      "\n",
      "class SampleTest < Minitest::Test\n",
      "  def test_sample\n",
      "    assert_equal 'RUBY', 'ruby'.upcase\n",
      "  end\n",
      "end\n",
      "===========================\n",
      "Run options: --seed 4409\n",
      "\n",
      "# Running:\n",
      "\n",
      ".\n",
      "\n",
      "Finished in 0.000957s, 1044.4888 runs/s, 1044.4888 assertions/s.\n",
      "\n",
      "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "### ファイル中のプログラムを実行\n",
    "echo \"===========================\"\n",
    "cat /Users/ftakao2007/work/ruby/tmp/sample_test.rb\n",
    "echo \"===========================\"\n",
    "\n",
    "ruby /Users/ftakao2007/work/ruby/tmp/sample_test.rb"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Run options: --seed 3850\n",
      "\n",
      "# Running:\n",
      "\n",
      ".\n",
      "\n",
      "Finished in 0.001102s, 907.7770 runs/s, 907.7770 assertions/s.\n",
      "\n",
      "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips\n"
     ]
    }
   ],
   "source": [
    "%%bash\n",
    "\n",
    "### コードを生成\n",
    "cat <<- EOS > /tmp/sample_test.rb\n",
    "require '/Users/ftakao2007/work/jupyter/vendor/bundle/ruby/2.3.0/gems/minitest-5.10.2/lib/minitest/autorun'\n",
    "\n",
    "class SampleTest < Minitest::Test\n",
    "  def test_sample\n",
    "    assert_equal 'RUBY', 'ruby'.upcase\n",
    "  end\n",
    "end\n",
    "EOS\n",
    "\n",
    "### 実行\n",
    "ruby /tmp/sample_test.rb"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
